<style>
    .row textarea {
        width: 100%;
        margin-bottom: 20px;
    }
</style>
<div class="container-fluid" style="margin-top: 20px;">
    {{ flash.output() }}
    <form action="#" enctype="multipart/form-data" method="post" class="form-group">
        <div class="form-inline">
            <label for="">选择文件：</label>
            <input type="file" name="file" class="form-control" accept=".xls,.xlsx" />
            <label style="margin-left: 20px; margin-right: 20px;"> 目标学校id： </label>
            <input type="number" name="schoolId" class="form-control" />
            <input type="submit" class="btn btn-success btn-sm" name="read" value="生成语句" style="width: 100px;margin-left: 20px;">
        </div>
    </form>
    {% if sqlResult is defined %}
        <form action="#" method="post" class="form-group">
            <div class="row">
                <blockquote>
                    <p>导入账号共{{ count['source'] }}，找到信息共{{ count['real'] }}个</p>
                </blockquote>
            </div>
            <div class="row col-md-12">
                <p>新数据中心</p>
                <textarea name="newCenter" rows="3" class="form-control">{{ sqlResult['newCenter'] }}</textarea>
                <p>老数据中心</p>
                <textarea name="oldCenter" rows="3" class="form-control">{{ sqlResult['oldCenter'] }}</textarea>
                <p>老学校</p>
                <input type="number" name="oldSchoolId" value="{{ school['old'] }}" class="form-control" style="width: 100px" />
                <textarea name="oldSchool" rows="3" class="form-control">{{ sqlResult['oldSchool'] }}</textarea>
                <p>新学校</p>
                <input type="number" name="newSchoolId" value="{{ school['new'] }}" class="form-control" style="width: 100px" />
                <textarea name="newSchool" rows="5" class="form-control">{{ sqlResult['newSchool'] }}</textarea>
                <input type="submit" class="btn btn-danger" name="exec" value="执行语句" style="width: 100px;margin-left: 20px;">
            </div>
        </form>
    {% endif %}
    {% if result is defined %}
        <div class="row">
            <blockquote>
                <p>执行结果如下</p>
            </blockquote>
        </div>
        <div class="row col-md-12">
            <p>新数据中心：{% if result['newCenter'] %}成功{% else %}失败{% endif %}</p>
            <p>老数据中心：{% if result['oldCenter'] %}成功{% else %}失败{% endif %}</p>
            <p>老学校：{% if result['oldSchool'] %}成功{% else %}失败{% endif %}</p>
            <p>新学校：{% if result['newSchool'] %}成功{% else %}失败{% endif %}</p>
        </div>
    {% endif %}
</div>
